export default class WebDB
{
    static getItem(key)
    {
        if(typeof localStorage === 'undefined')
        {
            return undefined;
        }
        return localStorage.getItem(key);
    }
    static setItem(key, value)
    {
        if(typeof localStorage === 'undefined')
        {
            return;
        }
        let strValue = '' + value;
        if(typeof value === 'object')
        {
            strValue = JSON.stringify(value);
        }
        localStorage.setItem(key, strValue);
    }

    static removeItem(key)
    {
        if(typeof localStorage === 'undefined')
        {
            return;
        }
        localStorage.removeItem(key);
    }
}